<!DOCTYPE html>
<html class="x-admin-sm">
<head>
    <meta charset="UTF-8">
    <title>用户列表</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width,user-scalable=yes, minimum-scale=0.4, initial-scale=0.8,target-densitydpi=low-dpi" />
    <link rel="stylesheet" href="/themes/admin/css/font.css">
    <link rel="stylesheet" href="/themes/admin/css/xadmin.css">
    <link rel="stylesheet" href="/themes/admin/css/common.css">
    <script src="/themes/admin/lib/layui/layui.js" charset="utf-8"></script>
    <script type="text/javascript" src="/themes/admin/js/xadmin.js"></script>
    <!--[if lt IE 9]>
    <script src="https://cdn.staticfile.org/html5shiv/r29/html5.min.js"></script>
    <script src="https://cdn.staticfile.org/respond.js/1.4.2/respond.min.js"></script>
    <![endif]-->
</head>
<body>
<div class="x-nav">
    <a class="layui-btn layui-btn-small" style="line-height:1.6em;margin-top:3px;float:right" onclick="location.reload()" title="刷新">
        <i class="layui-icon layui-icon-refresh" style="line-height:30px"></i></a>
</div>
<div class="layui-fluid">
    <div class="layui-row layui-col-space15">
        <div class="layui-col-md12">
            <div class="layui-card">
                <div class="layui-card-body layui-table-body layui-table-main">
                    <table class="layui-table layui-form">
                        <thead>
                        <tr>
                            <th>主题名称</th>
                            <th>作者</th>
                            <th>简介</th>
                            <th>图标</th>
                            <th>版本</th>
                            <th>操作</th>
                        </tr>
                        </thead>
                        <tbody>
                        {volist name="list" id="vo"}
                        <tr>
                            <td>{$vo.name}</td>
                            <td>{$vo.author}</td>
                            <td>{$vo.intro}</td>
                            <td><img src="{$vo.icon}"></td>
                            <td>{$vo.version}</td>
                            <td class="td-manage">
                                <button class="layui-btn layui-btn-normal" onclick="setTheme(1,'{$vo.title}')">设为PC端主题</button>
                                <button type="button" class="layui-btn layui-btn-danger" onclick="setTheme(2,'{$vo.title}')">设为移动端主题</button>
                            </td>
                        </tr>
                        {/volist}
                        </tbody>
                    </table>
                </div>
            </div>
        </div>
    </div>
</div>
</body>
<script>

    function setTheme(type,title) {
        $.ajax({
            type:"POST",
            data:{
                type:type,
                title:title
            },
            url:"/admin/theme/updateTheme",
            success:function (e) {
                if(e.code == 1){
                    layer.msg(e.msg,{icon:1})
                }else {
                    layer.msg(e.msg,{icon:2})
                }
            }

        })
    }
</script>
</html>